package Test;

import net.sf.json.JSONObject;



public class Jsonlib {
    private final static String text = "{\"pwd\":123,\"username\":\"yb\"}";  
	
	private final static String text_array = "[{\"pwd\":\"123\",\"username\":\"yb\"},{\"pwd\":\"123\",\"username\":\"yb\"}]";
	
	private final static  User user = new User("yb", "123");

	public static void main(String[] args) {
		beanToObject(user);

	}
	
	/**
     * ----------------------------------------------------------------json-lib-2.2.2-jdk15.jar包--------------------------------------------------------
     */
    public static  JSONObject beanToObject(User user){
    	JSONObject json = JSONObject.fromObject(user);  
        return json;
    	
    }

}
